package com.cn.springcloudwechat.mapper.mapper.attachment;

import com.cn.springcloudwechat.model.attachment.YmAttachment;
import com.cn.springcloudwechat.model.attachment.YmAttachmentRelevance;
import com.cn.springcloudwechat.model.dto.AttachmentDto;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public interface YmAttachmentMapper {
    int deleteByPrimaryKey(Long attachmentId);

    int insert(YmAttachment record);
    @Transactional(rollbackFor = Exception.class)
    Long insertSelective(YmAttachment record);

    YmAttachment selectByPrimaryKey(Long attachmentId);

    int updateByPrimaryKeySelective(YmAttachment record);

    int updateByPrimaryKey(YmAttachment record);

    /**
     * 根据类型和业务id查询附件
     *
     *  业务类型名称(1文章2问医生3交流圈4头像5课程6课程包7图文中的图片)
     * @return
     */
    List<YmAttachment> selectByRelevanceIdAndType(YmAttachmentRelevance ymAttachmentRelevance);

    List<AttachmentDto> selectAllUrl();

    List<AttachmentDto> queryAllUrl();
}